
<html>
	<head>
		<style>
			* { font-family: arial; font-size: 12px; }
			body { margin: 40px;}
			a { font-weight: bold; text-decoration: none; color: #000;}
			fieldset { 	
				margin: 0; letter-spacing:1px;
				padding: 4px; border: 1px solid #ccc; width: 500px; margin-top: 30px;
			}
		</style>
		<title>Sparcle MVC Example page</title>
	</head>
	<body>
	<?php //phpinfo(); ?>
		<a href="<?=View::url()?>index/">&raquo; Back to Index</a>
		
		<fieldset>
			<legend>Anchor example</legend>
			Scroll down, resize window to see this example more clearly. Click on the back to top link.
			<a name="test">Here is the "Back to top" anchor.</a> 
		</fieldset>
		
		<fieldset>
			<legend>GET example</legend>
			You can pass variables through the url. In this example you can only pass 2 variables
			to the view. The third variable will not pass becorse the function does not have that
			much artibutes.<br /><br />
			
			<div><b>Variable A:</b> <?=View::get('a')?></div>
			<div><b>Variable B:</b> <?=View::get('b')?></div>
			<div><b>Variable C:</b> <?=View::get('c')?></div>
			
			<br />
			<a href="<?=View::url()?>index/postgetexample/John/">Passing var A</a><br />
			<a href="<?=View::url()?>index/postgetexample/John/Doe/">Passing var A and B</a><br />
			<a href="<?=View::url()?>index/postgetexample/John/Doe/VarC/">Passing var A, B and C</a>
		</fieldset>
	
		<fieldset>
			<legend>POST example</legend>
			This example will make a post by an form. Try the text "test". <br /><br />
			<b>Return value:</b><?=View::get('postresult')?><br />
			<b>Post value:</b><?=View::post('testpost')?> <br />		
			<form method="post">
				<input type="text" name="testpost" value="test" />
				<input type="submit" name="testsubmit" value="Submit" />
			</form>
		</fieldset>
	
		<fieldset>
			<legend>ARRAY example</legend>
			<?php 
				foreach(View::get('test_array') as $key=>$value) {
					echo $key . " = " . $value . "<br>";
				}
			?>
		</fieldset>	
		
		<fieldset>
			<legend>Database example</legend>
			Output from "index.controller.php" in the "app/controllers" folder.<br /><br />
			<?php print_r(View::get('account')); ?>
		</fieldset>
		
		<br /><br />
		<a href="#test">Back to top</a>
	</body>
</html>